package org.cqipc.edu.common;

import lombok.experimental.Accessors;

import java.io.Serializable;

/**
 * @Description: 分页
 * @ClassNmae: PageCommon
 * @Author: HeYue
 * @DateTime: 2020-11-01 19:53
 **/
@Accessors(chain = true)
public class Pages implements Serializable {

    private Integer page;
    private Integer limit;


    public Pages(Integer page, Integer limit) {
        this.page = (page - 1) * limit;
        this.limit = limit;
    }

    public Integer getPage() {
        return page;
    }

    public void setPage(Integer page) {
        this.page = page;
    }

    public Integer getLimit() {
        return limit;
    }

    public void setLimit(Integer limit) {
        this.limit = limit;
    }

    @Override
    public String toString() {
        return "Pages{" +
                "page=" + page +
                ", limit=" + limit +
                '}';
    }
}
